<%@ page language="java" contentType="text/html; charset=utf-8"%>

<%@page import="cn.edu.scut.fsearch.comm.comm"%>
<%@page import="cn.edu.scut.fsearch.user.UserSearchOption"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<%
			int perPage = comm.NUM_PER_PAGE;
			UserSearchOption preOption = new UserSearchOption();
			preOption.getPreOptions(request);
			int type = preOption.getType().ordinal();
			String sflag = request.getParameter("flag");
			if (sflag == null)
				sflag = "0";
			String etemp = preOption.getEduSeString(preOption.getEduSE());
			String ttemp = preOption.getTopicString(preOption.getTopicSE());
			String utemp = preOption.getUniversitySeString(preOption
					.getUniversitySE());
		%>

		<title>下一代(IPv4/IPv6)互联网分布式搜索引擎平台</title>
		<link href="css/main.css" rel="stylesheet" type="text/css" />
		<link href="css/suggest.css" rel="stylesheet" type="text/css" />
		<!-- 引入一些js -->
		<script type="text/javascript" src="script/jquery.js"
			language="javascript"></script>
		<script type="text/javascript" src="script/json.js"></script>
		<script type="text/javascript" src="script/collector.js"></script>
		<script type="text/javascript" src="script/suggest.js"
			language="javascript"></script>
		<script type="text/javascript" src="script/myPageShow.js"
			language="javascript"></script>
		<meta name ="keywords" content="分布式搜索,SE6,联合搜索,教育网SE,高校联盟,专题搜索,下一代互联网分布式搜索引擎平台,教育网搜索引擎,ipv6搜索"> 
	</head>

	<body>
		<form name="form1" method="post"
			onsubmit="return search('<%=perPage%>')">
			<div id="logobg" align="center">
				<div id="logo">
					<div id="ipv6_enabled_www_test_logo" class="ipv6" align="center"></div>
					<a href="aboutus.jsp"><img src="images/logo.jpg" border="0" />
					</a>
				</div>
			</div>
			<table align="center">
			<tr><td><div align="right" style="width:984px;">欢迎访问！您的IP地址:<Strong><%=request.getRemoteAddr()%></Strong></div></td></tr>
				<tr>
					<td>
						<div id="mid" style="width:984px;overflow:hidden;">
							<div id="midcontent">
								<div id="search">
									<table width="570" height="80%">
										<tr>
											<td colspan="2">
												<div id="tabhit">
													<P style="float: left">
														<img class="topC0" src="images/00.png">
													</P>
													<P style="float: left">
														<img class="topC0" src="images/10.png">
													</P>
													<P style="float: left">
														<img class="topC0" src="images/20.png">
													</P>
												</div>
											</td>

										</tr>
										<tr>
											<td>
												<div id="searchinput">
													<input type="text" id="searchtext" />
													<input id="searchsubmit" type="submit" value="" />
												</div>
											</td>
											<td>
												<p>
													<a id="ipv6link" href="ipv6statistic.jsp">资源分布</a>
													<br>
													<a id="ipv6link" href="advanced.jsp">高级搜索</a>
												</p>
											</td>
										</tr>
									</table>
								</div>
								<div id="sort1" align="center">
									<div id="sortcheck">
										<table width="700" id="nodetable" align="left">
											<tr align="left">
												<td>
													<div>
														<table>
															<tr>
																<td valign="top">
																	<img src="images/sortcheck0.jpg" />
																</td>
																<td width="150" align="left">
																	<input type="radio" name="ipv" value="0" />
																	IPv4 资源
																</td>
																<td width="150" align="left">
																	<input type="radio" name="ipv" value="1" />
																	IPv6 资源
																</td>
																<td width="160" align="left">
																	<input type="radio" name="ipv" value="2" />
																	IPv4/IPv6 资源
																</td>
																<td>
																</td>
															</tr>
														</table>
													</div>
												</td>
											</tr>
											<tr class="nodetypes" align="left">
												<td>
													<div>
														<table>
															<tr>
																<td valign="top">
																	<img src="images/sortcheck1.jpg" />
																</td>

																<td>
																	<input type="checkbox" name="checkeduse" value="0" />
																	华南木棉
																	<a href="http://search.scut.edu.cn"><img src="images/huagongmumian.png"
																		style="height: 30px; width: 90px" /></a>
																</td>
																<td>
																	<input type="checkbox" name="checkeduse" value="1" />
																	北大天网
																	<a href="http://e.pku.edu.cn/"><img src="images/beidatianwang.png"
																		style="height: 30px; width: 90px" /></a>
																</td>
																<td>
																	<input type="checkbox" name="checkeduse" value="2" />
																	清华指南针
																	<a href="#"><img src="images/qinghuazhinanzhen.png"
																		style="height: 30px; width: 90px" /></a>
																</td>
																<td>
																</td>
															</tr>
														</table>
													</div>
												</td>
											</tr>
											<tr class="nodetypes" align="left">
												<td>
													<div>
														<table>
															<tr>
																<!-- 专题搜索 -->
																<td valign="top">
																	<img src="images/topicse.jpg" />
																</td>

																<td align="left">
																	<input type="radio" name="topicse" value="0" />
																	清华科技新闻
																</td>
																<td>
																	<input type="radio" name="topicse" value="1" />
																	北大科研论文
																</td>
																<td>
																	<input type="radio" name="topicse" value="2" />
																	华工教育新闻
																</td>
																<td>
																	&nbsp;
																</td>
															</tr>
														</table>
													</div>
												</td>

											</tr>
											<tr class="nodetypes">
												<td colspan='5' width="100%">
													<div>
														<table>
															<tr>
																<td valign="top">
																	<img src="images/sortcheck3.jpg" />
																</td>
																<td width="160">
																	<input type="checkbox" name="checkgxse" value="0" />
																	<img src="images/pku.jpg"
																		style="height: 15px; width: 15px" />
																	北京大学
																</td>
																<td width="160">
																	<input type="checkbox" name="checkgxse" value="1" />
																	<img src="images/tsing.jpg"
																		style="height: 15px; width: 15px" />
																	清华大学
																</td>
																<td width="160">
																	<input type="checkbox" name="checkgxse" value="2" />
																	<img src="images/scut.jpg"
																		style="height: 15px; width: 15px" />
																	华南理工大学
																</td>
																<td width="160">
																	<input type="checkbox" name="checkgxse" value="3" />
																	<img src="images/huazhong.jpg"
																		style="height: 15px; width: 15px" />
																	华中科技大学
																</td>
															</tr>
															<tr>
																<td valign="top">
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="4" />
																	<img src="images/dongbei.jpg"
																		style="height: 15px; width: 15px" />
																	东北大学
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="5" />
																	<img src="images/dongnan.jpg"
																		style="height: 15px; width: 15px" />
																	东南大学
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="6" />
																	<img src="images/beiyou.jpg"
																		style="height: 15px; width: 15px" />
																	北京邮电大学
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="7" />
																	<img src="images/dianzi.jpg"
																		style="height: 15px; width: 15px" />
																	电子科技大学
																</td>
															</tr>
															<tr>
																<td valign="top">
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="8" />
																	<img src="images/shangjiao.jpg"
																		style="height: 15px; width: 15px" />
																	上海交通大学
																</td>
																<td>
																	<input type="checkbox" name="checkgxse" value="9" />
																	<img src="images/xijiao.jpg"
																		style="height: 15px; width: 15px" />
																	西安交通大学
																</td>
																<td>
																</td>
																<td>
																	<select onchange="selectChange(this.value);">
																		<option value="0">
																			全部选择
																		</option>
																		<option value="1">
																			全部取消
																		</option>
																		<option value="2">
																			全部反选
																		</option>
																	</select>
																</td>
															</tr>
														</table>
														
														<div>
												</td>
											</tr>
										</table>
												
									</div>
									<div style="clear: both"></div>

								</div>
							</div>
						</div>

					</td>
				</tr>
				<tr >
				
		<td>
			<div class="links" style="width:984px;">
			<h3>IPv6热站</h3>
			  <a target="_blank" href="http://ipv6.dengtian.com">北京林业大学-登天家园论坛</a> 
		      <a  target="_blank" href="http://v6.oiegg.com">北师大论坛-蛋蛋网</a> 
		      <a target="_blank" href="http://forum.shisu.edu.cn">上海外国语大学-千研万语</a> 
		      <a target="_blank" href="http://bt.neu6.edu.cn">东北大学-六维空间</a> 
		      <a style="margin-right:0px;" target="_blank" href="http://bbs.scnu.edu.cn">华南师范大学新陶园论坛</a><br /> 
		      <a target="_blank" href="http://bt.ruc6.edu.cn">中国人民大学-品知人大</a> 
		      <a  target="_blank" href="http://www.paper.edu.cn">中国科技论文在线</a> 		      
		      <a target="_blank" href="http://forum.nsd.pku6.edu.cn">北京大学国家发展研究院</a> 
		      <a target="_blank" href="http://neunews.neu.edu.cn">东北大学新闻网</a> 
		      <a style="margin-right:0px;" target="_blank" href="http://pt.bit6.edu.cn">北京理工大学-极速之星</a> 
			</div>
			<div class="content">
				<div class="content-left">
				 	<a href="ipv6statistic.jsp" target="_blank" class="jump"></a>
					<p>信息检索是现代互联网应用体系结构的重要支柱。以IPv6为代表的下一代互联网， 为网上信息服务的发展、特别是为个性化和专业化信息资源的更大规模扩张提供空前的增长潜力，蕴涵着全新的机遇， 从而对信息检索技术提出了革命性的要求。<br /><a href="aboutus.jsp">详细&gt;&gt;</a></p>
					
				</div>
				<div class="content-right" text-size>
					<div>
                    					<table>
					<tr>
					<td>
					<a href="http://www.hust.edu.cn/"><img src="images/hust_logo.jpg" width="70" border="0"/></a>
					</td>
					<td>
					<Strong><FONT SIZE=2>华中科技大学</FONT></Strong>
					</td>
					<td>
					<a href="http://www.scut.edu.cn"><img src="images/scut_logo.jpg" width="70" border="0"/></a>
					</td>
					<td>
					<Strong><FONT SIZE=2>华南理工大学</FONT></Strong>
					</td>
					</tr>
					<tr>
					<td>
					<a href="http://www.pku.edu.cn/"><img src="images/bju_logo.jpg" width="70" border="0"/></a>
					</td>
					<td>
					<Strong><FONT SIZE=2>北京大学</FONT></Strong>
					</td>
					<td>
					<a href="http://www.tsinghua.edu.cn"><img src="images/tsinghua_logo.jpg" width="70" border="0"/></a>
					</td>
					<td>
					<Strong><FONT SIZE=2>清华大学</FONT></Strong>
					</td>
					</tr>
					</table>
					</div>
				</div>
			</div>
			</td>
		</tr>
		

				<tr>
					<td>
						<div id="copyright">
						<br>
							
							<p>
								Copyright (c) 2010 CCNL All Rights Reserved &nbsp;
								<a href="aboutus.jsp"><font
									style="color: #aaa; text-decoration: none">关于我们</font> </a>
							</p>
						</div>
					</td>
				</tr>
			</table>
		</form>
		
		<script type="text/javascript">
	/*首先恢复用户上次的选择*/
	var stype = "<%=type%>";
	var ese = "<%=etemp%>";
	var use = "<%=utemp%>";
	var tse = "<%=ttemp%>";
	ese = ese.split(",");
	use = use.split(",");
	tse = tse.split(",");
	
	//var Tags = document.getElementById('tabhit').attr("topC0");
	var Tags = $(".topC0");
	var TagsCnt = $(".nodetypes");
	var len=Tags.length; 
	var flag="<%=sflag%>";  //修改默认值
	//var flag = 0;
	for(i=0;i<len;i++){
		Tags[i].value = i;
		Tags[i].onmouseover=function(){changeNav(this.value)}; 
		TagsCnt[i].style.display='none'; 
	}
	Tags[flag].src='images/'+flag+'1.png';
	TagsCnt[flag].style.display='block';
	function changeNav(v){
		Tags[flag].src='images/'+flag+'0.png';
		TagsCnt[flag].style.display='none';
		flag=v; 
		Tags[v].src='images/'+flag+'1.png';
		TagsCnt[v].style.display='block';
	}

$(document).ready(function(){
	var checklist = document.getElementsByName ("checkeduse");
	for(var i=0;i<ese.length;i++)
    {
    	if(ese[i] != "" && ese[i] != null)
    	{
    		var index = parseInt(ese[i]);
			checklist[index].checked = 1;
		}
	}
	 checklist = document.getElementsByName ("checkgxse");
	 for(var i=0;i<use.length;i++)
	 {
	 	if(use[i] != "" && use[i] != null)
	 	{
			var index = parseInt(use[i]);
			checklist[index].checked = 1;
		}
	 }
	// checklist = document.getElementsByName ("topicse");
	// for(var i=0;i<tse.length;i++)
	// {
	 //	if(tse[i] != "" && tse[i] != null)
	 //	{
	//		var index = parseInt(tse[i]);
	//		checklist[index].checked = 1;
	//	}
	 //}
	if(tse[0] != "")
		document.getElementsByName ("topicse")[tse[0]].checked = true;
	document.getElementsByName ("ipv")[stype].checked = true;
	//document.getElementById("hid").style.display = "block";
});

function search(perPage)
{	
	  var qtext = document.form1.searchtext;
	  if(qtext.value == null || qtext.value == "")
	  {
	  	 alert("请输入查询关键字!");
	  	 return false;
	  }
	  var selNode = validSENode();
	  var ipv = getSourceType();
	  if(selNode != ":" && ipv != "" && selNode != "-1:-1:-1")
	  {
	  	//记录搜索的url
	  	var url="content.jsp?searchText="+encodeURI(qtext.value);
	  	url += "&page=0&perPage="+perPage;;
	  	url += "&ipv="+ipv;
	  	url += "&selNode="+selNode;
	  	url += "&hs=0";
	  	url += "&flag="+flag;
	  	url += "&span=";
	  	document.form1.action = url;
		document.form1.submit();
		return true;
	  }
	  else{
	  	alert("请至少选择一个搜索节点");
	  	return false;
	  }
}

function selectChange(c){
    if(c==1)
	{
	  var checklist = document.getElementsByName ("checkgxse");
	  for(var i=0;i<checklist.length;i++)
	  {
		 checklist[i].checked = 0;
	  }
	}
	else if(c==2)
	{
	  var checklist = document.getElementsByName ("checkgxse");
	  for(var i=0;i<checklist.length;i++)
	  {
		 if(checklist[i].checked == 1)
		 {
		 	checklist[i].checked = 0;
		 }
		 else
		 {
		 	checklist[i].checked = 1;
		 }
	  }
	}
	else if(c==0)
	{
	  var checklist = document.getElementsByName ("checkgxse");
	  for(var i=0;i<checklist.length;i++)
	  {
		 checklist[i].checked = 1;
	  }
	}
}

/*获取选择的搜索引擎节点的个数*/
function validSENode()
{
	 //获取教育网选择的节点
	 var result = "";
	 switch(flag)
	 {
	 	case 0:
	 		var checklist = document.getElementsByName ("checkeduse");
			 for(var i=0;i<checklist.length;i++)
			 {
				if(checklist[i].checked == 1)
				{
				  result += checklist[i].value;
				}
			 }
			  if(result == "")
	 			result = "-1";
			 result += ":-1:-1"
	 		break;
	 	case 1:
		 	var checklist = document.getElementsByName ("topicse");
			 for(var i=0;i<checklist.length;i++)
			 {
				if(checklist[i].checked == 1)
				{
				  result += checklist[i].value;
				  break;
				}
			 }
			 if(result == "")
	 			result = "-1";
			  result = "-1:-1:"+result;
	 		break;
	 	case 2:
	 		 var checklist = document.getElementsByName ("checkgxse");
			 for(var i=0;i<checklist.length;i++)
			 {
				if(checklist[i].checked == 1)
				{
				  result += checklist[i].value;
				}
			 }
			 if(result == "")
	 			result = "-1";
			  result = "-1:"+result+":-1"
	 		break;
	 } 
	 return result;
}

function getSourceType()
{
	 var checklist = document.getElementsByName ("ipv");
	 for(var i=0;i<checklist.length;i++)
	 {
		if(checklist[i].checked == 1)
		{
		  return checklist[i].value;
		}
	 }
}


</script>
<script language="JavaScript" type="text/javascript">
var Ipv6_Js_Server = (("https:" == document.location.protocol) ? "https://" : "http://");
 	document.write(unescape("%3Cscript src='" + Ipv6_Js_Server + "www.ipv6forum.com/ipv6_enabled/sa/SA1.php?id=1794' type='text/javascript'%3E%3C/script%3E"));
</script>	
</body>
</html>
